package priv.utrix.micro.controller;

import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import priv.utrix.micro.json.R;

/**
 * 控制层异常处理类
 *
 * @author utrix
 * @date 2021/1/29
 */
@RestControllerAdvice
public class HandlerController {

    @ExceptionHandler(BindException.class)
    public R<String> handlerBindException(BindException e) {
        return R.failed(e.getMessage());
    }

}
